-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bootstrap: Detect musl hosts #144092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
bootstrap: Detect musl hosts #144092
Conversation
rustbot has assigned @albertlarsan68. Use |
The alternative I would suggest is to check |
Is there a way to get this information in Python with public (i.e. not |
|
Ok. This looks simple enough. If it causes any trouble, we can later wrap it in a
Not sure if anyone runs bootstrap on s390x/sparc/powerpc/powerpc64... If I understand it correctly, if r? @Kobzol |
I'm running it on powerpc64(le) at the moment x)
Correct, the stage0 is completely useless and cannot be executed. I would be very surprised to see someone with a Python build for musl bootstrapping rustc with glibc as their system libc. |
Well the Ok, I agree that the described situation should be quite rare. Let's try. @bors r+ rollup |
Should I really not change it to use |
And here's the output on powerpc64-unknown-linux-musl host with this PR:
|
Oh, I misunderstood your earlier comment, I somehow thought that "SOABI" refers to the way the arch is checked in the current version of this PR. In that case yes, please switch to the approach using public API. @bors r- |
Currently, all non-Android Linux hosts are assumed to be using glibc. This obviously isn't very portable and will currently result in downloading a stage0 toolchain for glibc even on musl hosts. There are multiple ways to detect musl somewhat reliably, but the easiest option is to check for the python SOABI config variable, which has values like "cpython-313-x86_64-linux-gnu" or "cpython-313-powerpc64-linux-musl". Signed-off-by: Jens Reidel <[email protected]>
Changed it to use @rustbot ready |
Thanks! @bors r+ rollup |
Currently, all non-Android Linux hosts are assumed to be using glibc. This obviously isn't very portable and will currently result in downloading a stage0 toolchain for glibc even on musl hosts.
There are multiple ways to detect musl somewhat reliably, but the easiest option is to check for the python target, which is exposed in
sys.implementation._multiarch
and has values like "x86_64-linux-gnu" or "powerpc64le-linux-musl".